import http from '@/components/common/tui-request'

//获取单位工程下拉列表
export const getProjectUnitProjectManageList = (projectId) => {
	return http.request({
		url: `/project-unit-project/getProjectUnitProjectManageList/${projectId}`,
		method: 'GET',
	});
};

//获取分部分项下拉列表
export const getSysSubsectionManageList = () => {
	return http.request({
		url: `/sys-subsection/getSysSubsectionManageList`,
		method: 'GET',
	});
};

//获取分项验收列表
export const getProjectSubsectionList = (projectId,page,limit) => {
	return http.request({
		url: `/project-subsection/getProjectSubsectionList/${projectId}/${page}/${limit}`,
		method: 'GET',
	});
};

//新增分项验收
export const addProjectSubsection = (projectId,data) => {
	return http.request({
		url: `/project-subsection/addProjectSubsection/${projectId}`,
		data:data,
		method: 'POST',
	});
};

//送审
export const startProjectSubsectionProcess = (projectSubsectionId) => {
	return http.request({
		url: `/project-subsection/startProjectSubsectionProcess?projectSubsectionId=${projectSubsectionId}`,
		method: 'POST',
	});
};

//重新送审
export const reStartProjectSubsectionProcess = (projectSubsectionId) => {
	return http.request({
		url: `/project-subsection/reStartProjectSubsectionProcess?projectSubsectionId=${projectSubsectionId}`,
		method: 'POST',
	});
};

//修改检验批
export const updateProjectSubsection = (data) => {
	return http.request({
		url: `/project-subsection/updateProjectSubsection`,
		method: 'PUT',
		data:data
	});
};

//删除检验批
export const deleteUnSubProjectSubsection = (projectSubsectionId) => {
	return http.request({
		url: `/project-subsection/deleteUnSubProjectSubsection/${projectSubsectionId}`,
		method: 'DELETE',
	});
};

//确认审批
export const completeProjectSubsectionTask = (data) => {
	return http.request({
		url: `/project-subsection/completeProjectSubsectionTask`,
		data:data,
		method: 'POST',
	});
};

//通过id获取分项验收全部信息
export const getFullProjectSubsectionInfo = (projectSubsectionId) => {
	return http.request({
		url: `/project-subsection/getFullProjectSubsectionInfo?projectSubsectionId=${projectSubsectionId}`,
		method: 'GET',
	});
};

//获取未分项验收检验批信息
export const getProjectTenderSubsectionNoCheckedList = (projectId,projectSubsectionId) => {
	return http.request({
		url: `/project-tender-subsection/getProjectTenderSubsectionNoCheckedList/${projectId}?projectSubsectionId=${projectSubsectionId}`,
		method: 'GET',
	});
};

//获取用户待办及已办数据
export const getTask = (projectId) => {
	return http.request({
		url: `/project-subsection/getTask/${projectId}`,
		method: 'GET',
	});
};